package com.ygbhu.design.factory;

import com.ygbhu.design.factory.service.Car;

/**
 * @program: design-pattern
 * @description: 测试类
 * @author: smzhu3
 * @create: 2021-06-15 09:51
 **/
public class Test {
    public static void main(String[] args) {
        //简单工厂
        Car baoma = CarFactory.getCar("baoma");
        Car benchi = CarFactory.getCar("benchi");
        baoma.name();
        benchi.name();

        //工厂方法模式
        Car baoma1 = CarFactory.getBaoMaCar();
        Car benchi1 = CarFactory.getBenChiCar();
        baoma1.name();
        benchi1.name();
    }
}
